import { createRouter, createWebHashHistory } from 'vue-router';
import login from '../views/login.vue';

const routes = [
  {
    path: '/',
    name: 'login',
    component: login
  },
  {
    path: '/layout',
    name: 'layout',
    redirect: '/pageA',
    component: () => import('../views/layout.vue'),
    children: [
      {
        path: '/pageA',
        component: () => import('../views/pageA.vue'),
        name: 'pageA',
        meta: { title: 'pageA', icon: 'index' }
      },
      {
        path: '/pageB',
        component: () => import('../views/pageB.vue'),
        name: 'pageB',
        meta: { title: 'pageB', icon: 'index' }
      },
      {
        path: '/pageC',
        component: () => import('../views/pageB.vue'),
        name: 'pageC',
        meta: { title: 'pageC', icon: 'index' }
      }
    ]
  }
];

const router = createRouter({
  history: createWebHashHistory(),
  routes
});

export default router;
